<template>
   <div>
       <el-form ref="form" v-model="form" label-width="130px" >
          <el-form-item label="请选择查询类型">
            <el-select v-model="option"  placeholder="请选择">
               <el-option label="所有权信息查询" value="1"></el-option>
               <el-option label="他项权信息查询" value="2"></el-option>
               <el-option label="查封信息查询" value="4"></el-option>
               <el-option label="更正和异议查询" value="5"></el-option>
     </el-select>
  </el-form-item>


  <el-form-item label="受理流水号" >
    <el-col :span="8">
       <el-input v-model="servicenumber"></el-input>
    </el-col>
   <el-form-item label="土地证号">
      <el-col :span="8" >
       <el-input v-model="landnumber"></el-input>
       </el-col>
      </el-form-item>
   </el-form-item>


    <el-form-item label="产权人" >
    <el-col :span="8">
       <el-input v-model="owner"></el-input>
    </el-col>
       <el-form-item label="产权人身份证号" >
    <el-col :span="8">
       <el-input v-model="idcard"></el-input>
    </el-col>
      </el-form-item>
   </el-form-item>


    <el-form-item label="抵押人" >
    <el-col :span="8">
       <el-input v-model="pawnor"></el-input>
    </el-col>
   <el-form-item label="抵押人身份证号" >
    <el-col :span="8">
       <el-input v-model="pawnoridcard"></el-input>
    </el-col>
</el-form-item>
   </el-form-item>

   

    
   <el-form-item label="抵押权人">
      <el-col :span="8" >
       <el-input v-model="mortgagee"></el-input>
       </el-col>
       <el-form-item label="抵押权人身份证号">
      <el-col :span="8" >
       <el-input v-model="mortgageeidcard"></el-input>
       </el-col>
</el-form-item>
   </el-form-item>


   
    <el-form-item label="房屋坐落">
      <el-col :span="8" >
       <el-input v-model="location"></el-input>
       </el-col>
   <el-form-item label="门牌号">
      <el-col :span="8" >
       <el-input v-model="roomnumber"></el-input>
       </el-col>
</el-form-item>
   </el-form-item>

   <el-form-item label="建筑区划" >
    <el-col :span="8">
       <el-input v-model="buildingarea"></el-input>
    </el-col>
   <el-form-item label="房屋结构">
      <el-col :span="8" >
       <el-input v-model="buildingstructure"></el-input>
       </el-col>
</el-form-item>
   </el-form-item>

   <el-form-item label="异议关键词" >
    <el-col :span="8">
       <el-input v-model="keyword"></el-input>
    </el-col>
   </el-form-item>


  
  
 
  <el-form-item>
    <el-button type="primary" @click="onSubmit">查询</el-button>
    <el-button>取消</el-button>
  </el-form-item>
</el-form>

       
   </div> 
</template>

<script>

export default {
      data() {
      return {
         form:{

         },
       servicenumber:"",
       owner:"",
       idcard:"",
       pawnor:"",
       pawnoridcard:"",
       mortgagee:"",
       mortgageeidcard:"",
       roomnumber:"",
       landnumber:"",
       location:"",
       buildingarea:"",
       buildingstructure:"",
       option: '',
       keyword:"",
       
      }
    },
    methods: {
      onSubmit() {
        //所有权查询
         if(this.option==0){
            this.sa.msg("请选择查询类型");  
         }
         var the=this;
         if(this.option==1){  
                     
            if(this.idcard.replace(/\s+/g,"")==""&& this.owner.replace(/\s+/g,"")==""){
               this.sa.msg("所有权人或者身份证号不能为空");
               return;
            }
            this.sa.ajax("/synthesize/ownership",
            {owner:the.owner,idcard:the.idcard  },
            function(response){  
               console.log(response);            
               var tab = { id:'owner', name:'所有权',view: () => import('@/sa-view/statisticalquery/owner1.vue'),  params: {ownershipQueryList: response.data}};
               the.sa_admin.showTab(tab);

            }.bind(this),
            {type : 'get'}
            )  
           
         }else if(this.option==2){    //他项权查询
            this.sa.ajax("/synthesize/mortgage",
            {pawnor:the.pawnor,pawnoridcard:the.pawnoridcard,mortgagee:the.mortgagee,mortgageeidcard:the.mortgageeidcard},
            function(response){
                  console.log(response);
                  var tab = {  name:'他项权信息', view: () => import('@/sa-view/statisticalquery/otherpower.vue'),  params: {mortgageQueryList: response.data}};
                  the.sa_admin.showTab(tab);
           }
            ) 
         }else if(this.option==4){    //查封信息查询
           if(this.roomnumber.replace(/\s+/g,"")==""){
              this.sa.msg("请输入门牌号");
              return;
           } 
           this.sa.ajax("/synthesize/seal",
            {roomnumber:the.roomnumber},
            function(response){
                  console.log(response);
                  var tab = {id:'seal', name:'查封信息',  view: () => import('@/sa-view/statisticalquery/seal.vue'),  params: {sealQuery: response.data}};
                  the.sa_admin.showTab(tab);
               
           }
            ) 
         }else if(this.option==5){   //异议信息查询
            if(this.keyword.replace(/\s+/g,"")==""){
               this.sa.msg("请输入关键词");
               return;
            } 
           this.sa.ajax("/synthesize/dissentingregistration",
            {keyword:the.keyword},
            function(response){
                  console.log(response);
                  var tab = {id:'diffrent', name:'异议信息',  view: () => import('@/sa-view/statisticalquery/diffrent.vue'),  params: {diffrentList: response.data}};
                  the.sa_admin.showTab(tab);
               
           }
            ) 
         }

       
      }
    }
  
}
</script>


<style scoped>

</style>
